<p class="text-right doc-link">Table <a target="_blank" ng-href="{{ wikiLink }}gameobject"><span class="glyphicon glyphicon-link" aria-hidden="true"></span>gameobject</a></p>
<div class="row">
  <div class="col-xs-6">
    <div class="row">
      <div class="col-xs-3">
        <small>guid</small>
        <div class="input-group">
          <input class="form-control input-xs" type="text" ng-model="selected.guid">
          <div class="input-group-btn">
            <button class="btn btn-info input-xs" ng-click="openUnusuedGuidModal(selected, 'guid', 'gameobject')">...</button>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<div class="row">
  <div class="col-xs-6">
    <div class="row">
      <div class="col-xs-3">
        <small>map</small>
        <div class="input-group">
          <input class="form-control input-xs" type="text" ng-model="selected.map">
          <div class="input-group-btn">
            <button class="btn btn-info input-xs" ng-click="openSearchModal(selected, 'map', 'dbc/maps')">...</button>
          </div>
        </div>
      </div>
      <div class="col-xs-3">
        <small>zoneId</small>
        <input class="form-control input-xs" type="text" ng-model="selected.zoneId">
      </div>
      <div class="col-xs-3">
        <small>areaId</small>
        <input class="form-control input-xs" type="text" ng-model="selected.areaId">
      </div>
      <div class="col-xs-3">
        <small>spawnMask</small>
        <div class="input-group">
          <input class="form-control input-xs" type="text" ng-model="selected.spawnMask">
          <div class="input-group-btn">
            <button class="btn btn-info input-xs" ng-click="openFlagModal('partials/creature/modals/spawn-mask.html', selected, 'spawnMask', 4)">...</button>
          </div>
        </div>

      </div>
    </div>
  </div>
  <div class="col-xs-6">
    <div class="row">
      <div class="col-xs-3" ng-show="version.name == '3.3.5'">
        <small>phaseMask</small>
        <input class="form-control input-xs" type="text" ng-model="selected.phaseMask">
      </div>
      <div class="col-xs-2" ng-show="version.name == '6.x'">
        <small>PhaseId</small>
        <input class="form-control input-xs" type="text" ng-model="selected.PhaseId">
      </div>
      <div class="col-xs-2" ng-show="version.name == '6.x'">
        <small>PhaseGroup</small>
        <input class="form-control input-xs" type="text" ng-model="selected.PhaseGroup">
      </div>
      <div class="col-xs-2">
        <small>spawntimesecs</small>
        <input class="form-control input-xs" type="text" ng-model="selected.spawntimesecs">
      </div>
    </div>
  </div>
</div>
<div class="row">
  <div class="col-xs-6">
    <div class="row">
      <div class="col-xs-3">
        <small>position_x</small>
        <input class="form-control input-xs" type="text" ng-model="selected.position_x">
      </div>
      <div class="col-xs-3">
        <small>position_y</small>
        <input class="form-control input-xs" type="text" ng-model="selected.position_y">
      </div>
      <div class="col-xs-3">
        <small>position_z</small>
        <input class="form-control input-xs" type="text" ng-model="selected.position_z">
      </div>
      <div class="col-xs-3">
        <small>orientation</small>
        <input class="form-control input-xs" type="text" ng-model="selected.orientation">
      </div>
    </div>
  </div>
  <div class="col-xs-6">
    <div class="row">
      <div class="col-xs-3">
        <small>rotation0</small>
        <input class="form-control input-xs" type="text" ng-model="selected.rotation0">
      </div>
      <div class="col-xs-3">
        <small>rotation1</small>
        <input class="form-control input-xs" type="text" ng-model="selected.rotation1">
      </div>
      <div class="col-xs-3">
        <small>rotation2</small>
        <input class="form-control input-xs" type="text" ng-model="selected.rotation2">
      </div>
      <div class="col-xs-3">
        <small>rotation3</small>
        <input class="form-control input-xs" type="text" ng-model="selected.rotation3">
      </div>
    </div>
  </div>
</div>
<div class="row">
  <div class="col-xs-6">
    <div class="row">
      <div class="col-xs-3">
        <small>animprogress</small>
        <div class="input-group">
          <input class="form-control input-xs" type="text" ng-model="selected.animprogress">
        </div>
      </div>
      <div class="col-xs-3">
        <small>state</small>
        <div class="input-group">
          <input class="form-control input-xs" type="text" ng-model="selected.state">
        </div>

      </div>
      <div class="col-xs-3">
        <small>VerifiedBuild</small>
        <input class="form-control input-xs" type="text" ng-model="selected.VerifiedBuild">
      </div>
    </div>
  </div>
</div>
<br>
<div class="row">
  <div class="col-xs-4">
    <br>
    <button class="btn btn-primary" ng-click="editSelectedRowOf(new_gameobject, 'guid')"><i class="glyphicon glyphicon-refresh"></i> Edit</button>
    <button class="btn btn-danger" ng-click="deleteSelectedRowFrom(new_gameobject)"><i class="glyphicon glyphicon-remove"></i> Delete</button>
    <button class="btn btn-success" ng-click="addRowTo(new_gameobject, 'guid')"><i class="glyphicon glyphicon-plus"></i> Add new</button>
  </div>
  <div class="col-xs-2 pull-right">
    <br>
    <button class="btn btn-primary pull-right" ng-click="openFullScriptModal(new_gameobject, 'gameobject', 'id')">FULL Spawns Script</button>
  </div>
  <div class="col-xs-2 pull-right">
    <br>
    <button class="btn btn-success pull-right" ng-click="openDiffScriptModal('gameobject', 'id', 'guid', current_gameobject, new_gameobject)">DIFF Spawns Script</button>
  </div>
</div>
<br>
<div style="overflow-y: scroll !important;">
  <table class="table table-striped table-condensed">
    <thead>
      <th class="text-center"></th>
      <th class="text-center">guid</th>
      <th class="text-center">map</th>
      <th class="text-center">zoneId</th>
      <th class="text-center">areaId</th>
      <th class="text-center">spawnMask</th>
      <th class="text-center" ng-show="version.name == '3.3.5'">phaseMask</th>
      <th class="text-center" ng-show="version.name == '6.x'">PhaseId</th>
      <th class="text-center" ng-show="version.name == '6.x'">PhaseGroup<th>
      <th class="text-center">position_x</th>
      <th class="text-center">position_y</th>
      <th class="text-center">position_z</th>
      <th class="text-center">orientation</th>
      <th class="text-center">rotation0</th>
      <th class="text-center">rotation1</th>
      <th class="text-center">rotation2</th>
      <th class="text-center">rotation3</th>
      <th class="text-center">spawntimesecs</th>
      <th class="text-center">animprogress</th>
      <th class="text-center">state</th>
      <th class="text-center">VerifiedBuild</th>
    </thead>
    <tr ng-repeat="spawn in new_gameobject track by $index" ng-click="selectRow(new_gameobject, $index)" ng-class="{'tr-selected': $index == selectedRow}" id="{{ $index }}">
      <td><i class="glyphicon glyphicon-edit pointer" ng-click="selectRow(new_gameobject, $index)"></i></td>
      <td>{{ spawn.guid }}</td>
      <td>{{ spawn.map }}</td>
      <td>{{ spawn.zoneId }}</td>
      <td>{{ spawn.areaId }}</td>
      <td>{{ spawn.spawnMask }}</td>
      <td ng-show="version.name == '3.3.5'">{{ spawn.phaseMask }}</td>
      <td ng-show="version.name == '6.x'">{{ spawn.PhaseId }}</td>
      <td ng-show="version.name == '6.x'">{{ spawn.PhaseGroup }}</td>
      <td>{{ spawn.position_x }}</td>
      <td>{{ spawn.position_y }}</td>
      <td>{{ spawn.position_z }}</td>
      <td>{{ spawn.orientation }}</td>
      <td>{{ spawn.rotation0 }}</td>
      <td>{{ spawn.rotation1 }}</td>
      <td>{{ spawn.rotation2 }}</td>
      <td>{{ spawn.rotation3 }}</td>
      <td>{{ spawn.spawntimesecs }}</td>
      <td>{{ spawn.animprogress }}</td>
      <td>{{ spawn.state }}</td>
      <td>{{ spawn.VerifiedBuild }}</td>
    </tr>
  </table>
</div>
